<?php
require_once("soap/nusoap.php");
//require_once("config.php");

$smsid = isset($_GET['smsid']) ? $_GET['smsid']  : '';
$mobilenumber = isset($_GET['sender']) ? $_GET['sender']  : '';
$shortcode = isset($_GET['shortcode']) ? $_GET['shortcode']  : '';
$content =   isset($_GET['content']) ? urldecode($_GET['content'])  : '';
$uname =   isset($_GET['uname']) ? urldecode($_GET['uname'])  : '';
$upass =   isset($_GET['upass']) ? urldecode($_GET['upass'])  : '';
$content = trim($content);

 if($smsid<> null || $$mobilenumber <> null || $shortcode <> null || $content<> null){
 	echo getMO($shortcode,$shortcode,$smsid,$content,$smsid,$uname,$upass);
 } else {
 	echo  "-1";
 }


function getMO($commandcode,$serviceid,$userid,$message,$requestid,$username,$password) {
	if($username == "kimy" && $password=="kimy100151"){

		if(addmo($commandcode,$serviceid,$userid,$message,$requestid) == true){
			 return "ok";
		}
			/* if(checkrequestid($requestid)==1) {
				return "-1";
			} else {
				if(check_phone_time($userid) == true && checkphonetoday($userid)==true ){

				}else{
					return "Xin vui long cho sau 3 phut de tiep tuc su dung dich vu, ban da bi gioi han thoi gian su dung";
				}
			}    */
			return "Chuc mung ban da dang ky thanh cong dich vu Goc Khuat Tam Hon";
	}else {
		return "He thong dang duoc bao tri, xin ban quay lai sau";
	}
}




?>
